/*
 * @Author: 李天惊 uf_lee@163.com
 * @Date: 2022-11-21 13:09:19
 * @LastEditors: 李天惊 uf_lee@163.com
 * @LastEditTime: 2025-03-19 13:21:43
 * @FilePath: \global-brain\global-brain-admin\src\api\sys\knowledge\index.ts
 * Copyright (c) 2022 by 李天惊 uf_lee@163.com, All Rights Reserved.
 */
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 列表
export const sysKnowledgeListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysKnowledgeList',
      data: data
    }
  })
}

// 修改
export const sysKnowledgeSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysKnowledgeSee',
      data: data
    }
  })
}

// 修改
export const sysKnowledgeEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysKnowledgeEdit',
      data: data
    }
  })
}

// 新增
export const sysKnowledgeAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysKnowledgeAdd',
      data: data
    }
  })
}

// 删除
export const sysKnowledgeDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysKnowledgeDel',
      data: data
    }
  })
}

// 批量删除
export const sysKnowledgeBatchDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'sysKnowledgeBatchDel',
      data: data
    }
  })
}
